#!/bin/bash
set -e

# Path to the python executable and test script
PYTHON_EXEC="/home/tfj/code/py/cv/image_retrieval_eval/image-retrieval/.venv/bin/python"
TEST_SCRIPT_PATH="/home/tfj/code/py/cv/image_retrieval_eval/image-retrieval/test/evaluate/test_evaluator.py"

# --- Parameters ---
# Please fill in the values for the parameters below
EVALUATION_VERSION="fashion_clip_v1"
REF_EMBEDDING_FILE_PATH="/home/tfj/code/py/cv/image_retrieval/outputs/fashion_clip/fashion_clip_features_R.parquet"
INDEX_EMBEDDING_FILE_PATH="/home/tfj/code/py/cv/image_retrieval/outputs/fashion_clip/fashion_clip_features_I.parquet"

# --- Validation ---
if [ ! -f "$PYTHON_EXEC" ]; then
    echo "Error: Python executable not found at '$PYTHON_EXEC'"
    exit 1
fi

if [ ! -f "$TEST_SCRIPT_PATH" ]; then
    echo "Error: Test script not found at '$TEST_SCRIPT_PATH'"
    exit 1
fi

# --- Execution ---
echo "Starting test:"
echo "  - Python Executable: $PYTHON_EXEC"
echo "  - Test Script: $TEST_SCRIPT_PATH"
echo "  - evaluation_version: $EVALUATION_VERSION"
echo "  - ref_embedding_file_path: $REF_EMBEDDING_FILE_PATH"
echo "  - index_embedding_file_path: $INDEX_EMBEDDING_FILE_PATH"
echo "  - ref_data_file_path: $REF_DATA_FILE_PATH"
echo "----------------------------------------------------"

# Execute the test script with the provided arguments.
"$PYTHON_EXEC" "$TEST_SCRIPT_PATH" \
    --evaluation_version "$EVALUATION_VERSION" \
    --ref_embedding_file_path "$REF_EMBEDDING_FILE_PATH" \
    --index_embedding_file_path "$INDEX_EMBEDDING_FILE_PATH" \
    --ref_data_file_path "$REF_DATA_FILE_PATH"

echo "----------------------------------------------------"
echo "Test finished."



